Skip to content

[deploy-helpers] Accept a secrets file in previewBuildOutput - #16751

Merged
petebacondarwin merged 1 commit into
mainfrom
edmundhung/preview-build-output-secrets
Nov 17, 2026
Merged

petebacondarwin merged 1 commit into
mainfrom
edmundhung/preview-build-output-secrets

Conversation

@edmundhung

Copy link
Copy Markdown
Member

previewBuildOutput() now accepts the same secretsFile option as preview(). This lets the cf CLI add --secrets-file to cf previews deploy. Right now cf has no way to give a Preview its secrets: they have to be set in the dashboard or with wrangler preview secret put.

The upload path already supports this. runPreview() parses the file and uploads each entry as a secret_text binding, and previewBuildOutput() passes its args straight through to it. The only thing missing was secretsFile in the Pick<PreviewArgs, ...> type.

#16090 also edits that Pick, so whichever PR merges second will hit a one-line conflict.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: previewBuildOutput() is only used by the cf CLI. The user-facing flag will be documented in the cf change.

@changeset-bot

changeset-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b05642f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/deploy-helpers Minor
@cloudflare/remote-bindings Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk

ask-bonk Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented Nov 6, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@16751

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@16751

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@16751

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@16751

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@16751

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@16751

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@16751

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@16751

miniflare

npm i https://pkg.pr.new/miniflare@16751

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@16751

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@16751

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@16751

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@16751

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@16751

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@16751

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@16751

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@16751

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@16751

wrangler

npm i https://pkg.pr.new/wrangler@16751

commit: b05642f

@edmundhung
edmundhung marked this pull request as ready for review November 17, 2026 16:59
@workers-devprod
workers-devprod requested review from a team and NuroDev and removed request for a team November 17, 2026 16:59
@workers-devprod

workers-devprod commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — This is a small type change that exposes an upload path that already works, and it comes with a test. No issues found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

Adding secretsFile to the Pick is correct, and the args are passed straight through to the existing upload path. The new test checks both that secrets are merged into the upload request and that the result is redacted.


📝 Documentation: ✅ LGTM

The JSDoc @param args now mentions the secrets file, and the changeset describes the change accurately.


Reviewed commit: b05642f2

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Nov 17, 2026
@petebacondarwin
petebacondarwin merged commit 7b72b22 into main Nov 17, 2026
94 checks passed
@petebacondarwin
petebacondarwin deleted the edmundhung/preview-build-output-secrets branch November 17, 2026 19:23
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants